package router

import (
	"360/api/handler"
	"github.com/gin-gonic/gin"
	"net/http"
	"time"
)

func Router() *gin.Engine {
	r := gin.Default()
	r.GET("/", func(c *gin.Context) {
		time.Sleep(5 * time.Second)
		c.String(http.StatusOK, "Welcome Gin Server")
	})
	r.GET("/send", handler.Send)
	r.POST("/login", handler.Login)
	r.POST("/upload", handler.Upload)
	r.POST("/videoAdd", handler.VideoAdd)
	r.POST("/videoList", handler.VideoList)
	r.POST("/videoFind", handler.VideoFind)
	r.POST("/videoLog", handler.VideoLog)
	r.POST("/videoLogList", handler.VideoLogListReq)
	r.POST("/hotList", handler.HotList)
	r.POST("/esSync", handler.EsSync)
	r.POST("/esSearch", handler.EsSearch)
	return r
}
